<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditCustomerTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditCustomerLabel_id}" for="id" />
                    <h:inputText id="id" value="#{customerController.selected.id}" title="#{bundle.EditCustomerTitle_id}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_civility}" for="civility" />
                    <h:inputText id="civility" value="#{customerController.selected.civility}" title="#{bundle.EditCustomerTitle_civility}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{customerController.selected.firstName}" title="#{bundle.EditCustomerTitle_firstName}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_firstName}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{customerController.selected.lastName}" title="#{bundle.EditCustomerTitle_lastName}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_lastName}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_address1}" for="address1" />
                    <h:inputText id="address1" value="#{customerController.selected.address1}" title="#{bundle.EditCustomerTitle_address1}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_address1}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_address2}" for="address2" />
                    <h:inputText id="address2" value="#{customerController.selected.address2}" title="#{bundle.EditCustomerTitle_address2}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_address3}" for="address3" />
                    <h:inputText id="address3" value="#{customerController.selected.address3}" title="#{bundle.EditCustomerTitle_address3}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_zipCode}" for="zipCode" />
                    <h:inputText id="zipCode" value="#{customerController.selected.zipCode}" title="#{bundle.EditCustomerTitle_zipCode}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_zipCode}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_city}" for="city" />
                    <h:inputText id="city" value="#{customerController.selected.city}" title="#{bundle.EditCustomerTitle_city}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_city}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_country}" for="country" />
                    <h:inputText id="country" value="#{customerController.selected.country}" title="#{bundle.EditCustomerTitle_country}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_country}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{customerController.selected.phone}" title="#{bundle.EditCustomerTitle_phone}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_mobile}" for="mobile" />
                    <h:inputText id="mobile" value="#{customerController.selected.mobile}" title="#{bundle.EditCustomerTitle_mobile}" />
                    <h:outputLabel value="#{bundle.EditCustomerLabel_email}" for="email" />
                    <h:inputText id="email" value="#{customerController.selected.email}" title="#{bundle.EditCustomerTitle_email}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_login}" for="login" />
                    <h:inputText id="login" value="#{customerController.selected.login}" title="#{bundle.EditCustomerTitle_login}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_login}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_password}" for="password" />
                    <h:inputText id="password" value="#{customerController.selected.password}" title="#{bundle.EditCustomerTitle_password}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_createdDate}" for="createdDate" />
                    <h:inputText id="createdDate" value="#{customerController.selected.createdDate}" title="#{bundle.EditCustomerTitle_createdDate}" required="true" requiredMessage="#{bundle.EditCustomerRequiredMessage_createdDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_updatedDate}" for="updatedDate" />
                    <h:inputText id="updatedDate" value="#{customerController.selected.updatedDate}" title="#{bundle.EditCustomerTitle_updatedDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditCustomerLabel_deletedDate}" for="deletedDate" />
                    <h:inputText id="deletedDate" value="#{customerController.selected.deletedDate}" title="#{bundle.EditCustomerTitle_deletedDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                </h:panelGrid>
                <h:commandLink action="#{customerController.update}" value="#{bundle.EditCustomerSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditCustomerViewLink}"/>
                <br />
                <h:commandLink action="#{customerController.prepareList}" value="#{bundle.EditCustomerShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/admin/admin.xhtml" value="#{bundle.EditCustomerIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
